

#ifndef VSHAPE_H
#define VSHAPE_H

#include<stdio.h>
#include<stdlib.h>


typedef struct vertattrib VertAttrib;

class VShape{
  protected:
  VertAttrib * a_normal;
  VertAttrib * a_vertices;
  VertAttrib * attrib_list;
	//float * v_normals;
	//float * vertices;
	unsigned int   * triangles;
  float * tex_coord;
  bool tex;
  int v_id;
  int n_id;
  int t_id;
	float xmin, xmax, ymin, ymax, zmin, zmax;
	unsigned int n_vertices, n_triangles;
	public:
	void Draw ();
  void GetBBox (float* xmin, float* xmax, 
                float* ymin, float* ymax, 
                float* zmin, float* zmax);
  void SetNormalId(int id);
  void SetVertId(int id);
  VShape ();
  float* GetNormalArray ();
  float* GetVertArray ();
  unsigned int * GetTriangleArray ();
  void SetNormalArray (float * a);
  void SetVertArray (float * a);
  void AddVertAttrib (int _id,int _size,int _type,int _normalize,int _stride,float * _pointer);
  unsigned int GetNTriangles ()
  {
    return n_triangles;
  }
};

void vs_normalize (float v[3]);

void vs_normcrossprod(float v1[3], float v2[3], float out[3]);

		
#endif
